<template>
  <div class="container">
    <div class="app-container">
      <el-input size="mini" placeholder="请输入一体杆名称" style="width: 200px; margin-right: 10px;" />
      <el-input size="mini" placeholder="请输入一体杆编号" style="width: 200px; margin-right: 10px;" />
      <el-select size="mini" placeholder="请选择处置状态" style="width: 200px; margin-right: 10px;">
      <!-- 可以添加更多选项 -->
      </el-select>
      <el-button type="primary" size="mini" style="border-radius: 4px;margin-left: 20px;" @click="search">查询</el-button>

      <el-table :data="list" style="width: 100%; margin-top: 20px;">
        <el-table-column align="center" type="index" label="序号" width="50" />
        <el-table-column align="center" prop="poleName" label="一体杆名称" />
        <el-table-column align="center" prop="poleNumber" label="一体杆编号" />
        <el-table-column align="center" prop="errorType" label="故障类型" />
        <el-table-column align="center" prop="handleStatus" label="处置状态" />
        <el-table-column align="center" prop="warningTime" label="告警时间" />
        <el-table-column align="center" label="操作" width="260">
          <template>
            <el-button size="mini" disabled>派单</el-button>
            <el-button size="mini">详情</el-button>
            <el-button size="mini" disabled>删除</el-button>
          </template>
        </el-table-column>
        <el-row type="flex" justify="end">
          <el-pagination
            :current-page="pageParams.page"
            :page-sizes="[10, 20, 50, 100]"
            :page-size="pageParams.pageSize"
            layout="total, sizes, prev, pager,jumper, next"
            :total="total"
            @current-change="changePage"
          />
        </el-row>
      </el-table></div>
  </div>
</template>
<script>
import { getAlarmRecordAPI } from '@/api'

export default {
  name: 'AlarmRecord',
  data() {
    return {
      list: [],
      total: 0,
      pageParams: {
        handleStatus: '',
        poleNumber: '',
        poleName: '',
        page: 1,
        pageSize: 10
      }
    }
  },
  created() {
    this.getAlarmRecord()
  },
  methods: {
    changePage(page) {
      this.pageParams.page = page
      this.getAlarmRecord()
    },
    async getAlarmRecord() {
      const { rows, total } = await getAlarmRecordAPI(this.pageParams)
      this.list = rows
      this.total = total
    },
    search() {
      this.getAlarmRecord()
    }
  }
}
</script>
